(()=>{var a=(n=>(n.CPRA="usca",n.CCPA="usca",n.CDPA="usva",n.USNATIONAL="usnat",n.COLORADO="usco",n.CTDPA="usct",n.UCPA="usut",n.IAB2V2="tcfeuv2",n))(a||{}),u=(n=>(n[n.CPRA=8]="CPRA",n[n.CCPA=8]="CCPA",n[n.CDPA=9]="CDPA",n[n.USNATIONAL=7]="USNATIONAL",n[n.COLORADO=10]="COLORADO",n[n.UCPA=11]="UCPA",n[n.CTDPA=12]="CTDPA",n[n.IAB2V2=2]="IAB2V2",n))(u||{});var d=()=>{let p=[],e={};return Object.keys(u).forEach(t=>{let s={};s[t]=u[t],e=Object.assign(s,e)}),Object.keys(a).map(t=>({name:t,value:a[t]})).forEach(t=>{let s=`${e[t.name]}:${t.value}`;p.push(s)}),p.filter((t,s)=>p.indexOf(t)===s)};var c=class{constructor(){this.LOCATOR_NAME="__gppLocator";this.win=window;this.customInit="";this.init=()=>{(!this.win.__gpp||typeof this.win.__gpp!="function")&&(this.win.__gpp=this.executeGppApi,window.addEventListener("message",this.messageHandler,!1),this.addFrame(this.LOCATOR_NAME))};this.removeGppApi=()=>{delete this.win.__gpp;let e=document.querySelectorAll(`iframe[name=${this.LOCATOR_NAME}]`)[0];e&&e.parentElement.removeChild(e)};this.executeGppApi=(...e)=>{var o;let r=(o=this.win)==null?void 0:o.__gpp;if(r.queue=r.queue||[],r.events=r.events||[],!e.length||e.length===1&&e[0]==="queue")return r.queue;if(e.length===1&&e[0]==="events")return r.events;let t=e[0],s=e.length>1?e[1]:null,i=e.length>2?e[2]:null;switch(t){case"ping":return this.getPingRequest(s);case"addEventListener":return this.addEventListener(s,i);case"removeEventListener":return this.removeEventListener(i);default:this.addToQueue(t,s,i);return}};this.getPingRequest=e=>{let r={gppVersion:1.1,cmpStatus:"stub",cmpDisplayStatus:"hidden",signalStatus:"not ready",supportedAPIs:d(),currentAPI:"",cmpId:Number.parseInt("28"),sectionList:[],applicableSections:[0],gppString:"",parsedSections:{}};return e&&e(r,!0),r};this.addFrame=e=>{let r=this.win.document,t=Boolean(this.win.frames[e]);if(!t)if(r.body){let s=r.createElement("iframe");s.style.cssText="display:none",s.name=e,s.setAttribute("title","GPP Locator"),r.body.appendChild(s)}else setTimeout(()=>{this.addFrame(e)},5);return!t};this.addEventListener=(e,r)=>{let t=this.win.__gpp;return t.events=t.events||[],t!=null&&t.lastId||(t.lastId=0),t.lastId++,t.events.push({id:t.lastId,callback:e,parameter:r}),{eventName:"listenerRegistered",listenerId:t.lastId,data:!0,pingData:this.getPingRequest()}};this.removeEventListener=e=>{let r=!1,t=this.win.__gpp;return t.events=t.events||[],t.events=t.events.filter(s=>s.id.toString()===e.toString()?(r=!0,!1):!0),{eventName:"listenerRemoved",listenerId:e,data:r,pingData:this.getPingRequest()}};this.addToQueue=(e,r,t)=>{let s=this.win.__gpp;s.queue=s.queue||[],s.queue.push([e,r,t])};this.messageHandler=e=>{let r=typeof e.data=="string",t;try{t=r?JSON.parse(e.data):e.data}catch(s){t=null}if(t&&t.__gppCall){let s=t.__gppCall,i=this.win.__gpp;i(s.command,function(o,m){let n={__gppReturn:{returnValue:o,success:m,callId:s.callId}};e&&e.source&&e.source.postMessage&&e.source.postMessage(r?JSON.stringify(n):n,e.origin||"*")},s.parameter)}};this.customInit||this.init()}},A=new c;})();